<include file="../header" />
<body class="J_scroll_fixed">
<style type="text/css">
    .btn,.btn-danger,.btn-info,.btn-success,.btn-warning{
        width: 80px;
        /*height: 18px;*/
        padding: 2px 0px 2px 0px;
        margin: 1px 0px 1px 0px;
    }
    select{
        width: auto
    }
</style>
<script type="text/javascript">
    $(function() {

        $("input[name=checkAll]").click(function() {
            var checkboxs = $("input.checkItem");
            if($("input[name=checkAll]").is(':checked')) {
                for(var i = 0 ;i<checkboxs.length;i++) {
                    checkboxs[i].checked = true;
                }
            }else{
                for(var i = 0 ;i<checkboxs.length;i++) {
                    checkboxs[i].checked = false;
                }
            }
        });

    });
</script>

<form class="well form-search" method="post" style="float:left;width:100%;" action="{:U('groupOrder/index')}">
    <div class="search_type cc mb10">
        <div class="mb10">
        <span class="mr20">
            状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态：{:getEnumSelectWidget($statusEnum, "o#status", $status, 1)}
            &nbsp;团购码：<input type="text" name="o#group_code-like" style="width: 100px" value="{$group_code}" />
            &nbsp;患者姓名：<input style="width: 90px" type="text" name="o#patient_name-like" value="{$patient_name}" />
            &nbsp;微信昵称：<input style="width: 90px" type="text" name="cus#nickname-like" value="{$nickname}" />
            <br>
            开始时间：<input style="width: 90px" type="text" value="{$begin_time}" class="date J_date" name="o#create_time-egt" />
            &nbsp;截止时间：<input style="width: 90px" type="text" value="{$end_time}" class="date J_date" name="o#create_time-elt" />
            &nbsp;<button class="btn btn-primary" type="submit">搜索</button>
            &nbsp;<a class="btn" href="{:U('groupOrder/index')}">重置</a>
        </span>
        </div>
    </div>
</form>
<div class="wrap J_check_wrap">

    <ul class="nav nav-tabs">
        <li class="active"><a href="{:U('group_code/index')}">列表</a></li>
    </ul>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th style="min-width: 50px" >产品信息</th>
            <th style="min-width: 50px" width="180px">客户信息</th>
            <th style="min-width: 50px" width="150px">备注</th>
            <th style="min-width: 120px">发票信息</th>
            <th>收件信息</th>
            <th style="min-width: 50px" width="150px">团购码</th>
            <th style="min-width: 50px" width="120px">状态</th>
            <th style="min-width: 80px">操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="orderList" item="vo">
            <tr>
                <td>
                    <a style="font-weight: bold">{$vo.product_name}</a> x <a style="color: #ed9a63">{$vo.number}</a> 件
                    <br/>
                    <if condition="$vo['status'] gt '0'">
                        规格：【<a>{$vo.size}</a>】，单价：<a style="color: #ed7667">{$vo.price}</a> 元
                    <else/>
                        规格：【<a>{$vo.size}</a>】，团购价：<a style="color: #ed7667">{$vo.group_price}</a> 元
                    </if>
                </td>
                <td>
                    <if condition="$vo['patient_name'] neq ''">
                        患者姓名：<a style="color: #45a1de">{$vo.patient_name}</a>
                        <br/>
                        微信昵称：<a style="color: #1cc385">{$vo.nickname}</a>
                    </if>
                </td>
                <td>
                    <a style="color: #ed7667;">{$vo.note}</a><br/>
                </td>
                <td>
                    <if condition="$vo['need_invoice'] neq ''">
                    【{:getEnumString($defaultEnum, $vo['need_invoice'])}】
                    </if>
                    <if condition="$vo['invoice_name'] neq ''">
                        <a style="color: #45a1de">{$vo.invoice_name}</a>
                    </if>
                    <br/>
                    <if condition="$vo['invoice_number'] neq ''">
                        &nbsp;发票号：<a style="color: #45a1de">{$vo.invoice_number}</a>
                    </if>
                </td>
                <td>
                    <a style="color: #45a1de">
                    <if condition="$vo['receive_name'] neq ''">
                    {$vo.receive_name}，{$vo.receive_contact}
                    <br>
                    {$vo.receive_address}
                    </if>
                    </a>
                </td>
                <td><a style="color: #45a1de">{$vo.group_code}</a></td>
                <td>
                    <if condition="$vo['status'] eq '-2'">
                        <a style="color: #45a1de;">已预订</a><br/>{$vo.create_time}
                    </if>
                    <if condition="$vo['status'] eq '-1'">
                        <a style="color: #45a1de;">待付款</a><br/>{$vo.update_time}
                    </if>
                    <if condition="$vo['status'] eq '1' && $vo['need_invoice'] gt '0'">
                        <a style="color: #de7d74">已付款</a><br/>{$vo.pay_time}
                    </if>
                    <if condition="$vo['status'] eq '2'">
                        <a style="color: #1cc385">已发货</a><br/>{$vo.outstock_time}
                    </if>
                </td>
                <td>
                    <if condition="$vo['status'] eq '1' && $vo['need_invoice'] gt '0'">
                        <a class="btn btn-success" href='{:U("order/endDelivery",array("id"=>$vo["order_id"],"home"=>"groupOrder"))}'>发货</a>
                        <!--a class="btn btn-warning" onclick="if(confirm('确认关闭此订单么?')==false)return false;" href='{:U("coupon/closeOrder",array("id"=>$vo["coupon_id"]))}' >关闭订单</a-->
                    </if>
                    <if condition="$vo['status'] eq '2'">
                        <a style="color: #1cc385">
                            {$vo.express_company}
                            <br/>
                            {$vo.delivery_number}
                        </a>
                    </if>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>